Don't retry requests when you get 400 HTTP code#420
Conversation
The CLI does implement a retry of HTTP requests for certain status codes. But retrying for 400 is incorrect. If there is such an API expecting retry on 400, it should be fixed to return a reasonable status code other than 400.
Changelist by BitoThis pull request implements the following key changes.
|
There was a problem hiding this comment.
Code Review Agent Run #5c4dd2
Actionable Suggestions - 1
-
pkg/util/helper.go - 1
- Removed retry behavior for Bad Request responses · Line 72-72
Review Details
-
Files reviewed - 1 · Commit Range:
43c0389..43c0389- pkg/util/helper.go
-
Files skipped - 0
-
Tools
- Whispers (Secret Scanner) - ✔︎ Successful
- Detect-secrets (Secret Scanner) - ✔︎ Successful
Bito Usage Guide
Commands
Type the following command in the pull request comment and save the comment.
-
/review- Manually triggers a full AI review. -
/pause- Pauses automatic reviews on this pull request. -
/resume- Resumes automatic reviews. -
/resolve- Marks all Bito-posted review comments as resolved. -
/abort- Cancels all in-progress reviews.
Refer to the documentation for additional commands.
Configuration
This repository uses Default Agent You can customize the agent settings here or contact your Bito workspace admin at mithil@platform9.com.
Documentation & Help
The CLI does implement a retry of HTTP requests for certain status codes. But retrying for 400 is incorrect. If there is such an API expecting retry on 400, it should be fixed to return a reasonable status code other than 400.
Summary by Bito
This pull request modifies the HTTP retry logic by removing HTTP 400 errors from retry conditions, ensuring only appropriate status codes trigger retries. The changes also include a minor documentation fix to correct a comment typo in the logger interface, improving both error handling robustness and code documentation clarity.